package com.lvyq.myplayer.util

import okhttp3.Call
import okhttp3.Callback
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.Response
import java.io.IOException

/**
 * 文件描述：HttpUtil
 * 作者：lvyq
 * 创建时间：2025-04-16
 * 修改时间：2025-04-16
 */
open class HttpUtil {
    val client by lazy { OkHttpClient()  }
    /**
     * send请求
     */
   open fun sendGet( url:String){

        val reuqest = Request.Builder()
            .url(url)
            .get()
            .build()
        client.newCall(reuqest).enqueue(object : Callback{
            override fun onFailure(call: Call, e: IOException) {
                println("获取数据失败")
            }

            override fun onResponse(call: Call, response: Response) {
              println("获取数据成功")
            }

        })
    }


}